﻿
namespace Patterns4Net.Tests.PatternEnforcer.Core.Patterns.Regression
{
    using System;
    using NUnit.Framework;
    using Patterns4Net.Core.Patterns;
    using Patterns4Net.PatternEnforcer.Core.Patterns;

    [TestFixture]
    public class FactoryMethodCheckerTest : PatternCheckerTestBase
    {
        [Test]
        [TestCase("PseudoVoidFactory")]
        [TestCase("IntFactory")]
        [TestCase("PseudoNonVirtualDouble")]
        public void RunAllTest(string method)
        {
            this.TestChecker(
                new FactoryMethodChecker(), 
                typeof(FactoryMethodCheckerTest), 
                method, 
                m => new FactoryMethod(m));
        }

        [PatternTest(false)]
        public virtual void PseudoVoidFactory()
        {                        
        }

        [PatternTest(true)]
        public virtual int IntFactory()
        {
            return 0;
        }

        [PatternTest(false)]
        public double PseudoNonVirtualDouble()
        {
            return Math.PI;
        }
    }
}
